#ifndef CLIENTWINDOW_H
#define CLIENTWINDOW_H

#include <QObject>
#include <QWidget>
#include <QMainWindow>
#include <QMenu>
#include <QMenuBar>
#include <QToolbar>
#include <QBoxLayout>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QString>
#include <QLabel>
#include <QFileDialog>
#include <QMessageBox>
#include <QPixmap>
#include <QInputDialog>
#include <QProgressDialog>
#include <QSlider>


#include "../Common/Observer.h"
#include "../Common/Song.h"
#include "../Common/Playlist.h"
#include "../Common/PlaylistWidget.h"
#include "../Common/GlobalError.h"
#include "../Common/AudioSystem.h"

#include "PlaylistClient.h"
#include "MulticastClient.h"

/*-------------------------------------------------------------------------------------------
--
--	CLASS: ClientWindow
--
--	Date: March 22, 2010
--
--	REVISIONS (Date and Description):
--
--	DESIGNER: Erick Ribeiro
--
--	PROGRAMMER: Erick Ribeiro
--
--  INTERFACE: class ClientWindow : public QMainWindow, public Observer
--
--  RETURNS: N/A
--
--	NOTES: Program class for the Client window GUI. Handles the layout, menu items, and
--         other GUI related functions.
--
-------------------------------------------------------------------------------------------*/
class ClientWindow : public QMainWindow, public Observer
{
Q_OBJECT

public:
    ClientWindow (QWidget * parent = 0);
    void notify (Observable * obj, int eventCode);

protected slots:
    // Menu handlers
    void connect ();
    void disconnect ();
    void recordAndUpload ();
    void chooseFileAndUpload ();
    void handleUpload (int eventCode);

    // Playback handlers
    void play ();
    void pause ();
    void stop ();
    void volumeChanged (int volume);

private:
    PlaylistClient  * playlistClient;
    MulticastClient * multicastClient;

    QToolBar        * playbackBar;
    QAction         * playAction;
    QAction         * pauseAction;
    QAction         * stopAction;
    QSlider         * volumeSlider;

    QVBoxLayout     * mainLayout;
    PlaylistWidget  * playlistWidget;

    QPixmap         * logo;
    QLabel          * imageLabel;

    QProgressDialog * uploadStatus;

    void initMenu ();
    void updateMenu ();
    void initMainLayout ();
    void updateGUI ();
};

#endif
